//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef __ListSmile_h__
#define __ListSmile_h__
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include "ListAncestorMol.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
  class ListSmile {

    private:

      String*                filename;

      TListE <SmileStruct>*  allSmilesMol;
      double**               lingoSimilarity;
      double*                averageSimDistance;

      bool                   fileGZ;
      bool                   lingoSimComplete;

    protected:

      void                    ClearLingoSimilarity();
      void                    ClearAverageSimDistance();
        
    public:

      //Constructor and Destructor
      ListSmile();
      ListSmile(String*);
      
      ~ListSmile();

      //Input Functions
      void                    Filename(String*);
      void                    AllSmiles(TListE <SmileStruct>*);

      //Output Functions
      String*                 Filename(void);
      bool                    FileGZ(void);
      TListE <SmileStruct>*   AllSmiles(void);
      double**                LingoSimilarity(void);
      double*                 AverageSimDistance(void);

      //Operations Funtions
      int                     ExtractSmiles(void);
      int                     ExtractSmiles(String*);
      int                     ExtractSmiles(int, int);
      int                     ExtractSmiles(String*, int, int);
      int                     ExtractSmilesPos(long, long);
      int                     ExtractSmilesPos(String*, long, long);

      int                     ObtainLingos(void);
      int                     ObtainLingos(String*);
      
      bool                    ObtainSimilarityMatrix(void);
      int                     ObtainAverageSimMatrix(void);

      bool                    ObtainSimilarityMatrixWithoutNumber(void);
      int                     ObtainAverageSimMatrixWithoutNumber(void);

      bool                    ObtainDistanceBySimilarityMatrix(void);
      int                     ObtainAverageDistanceBySimMatrix(void);
      
      bool                    ObtainDistanceBySimilarityMatrixWithoutNumber(void);
      int                     ObtainAverageDistanceBySimMatrixWithoutNumber(void);

      void                    RandomFile(int);
      void                    ReadFile();
      long                    OrderFile(String*, String*, int, String*);
      long                    ReduceFile(String*, String*);

      void                    OrderFileByAncestorCluster(String*, String*);
      void                    ReduceFileToAncestorLevel(String*, String*, int);
      void                    GetClusterByAncestorLevel(String*, String*, int); 

      double                  ObtainLingoSim(char*, char*);

      void                    WriteLingoSimMatrix(String*);
      
      ListSmile               operator=(const ListSmile&); 
        
  };
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#endif
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//

